import React, { Component } from 'react';
import '../styles/MyHeader.scss'
import { AudioOutline } from 'antd-mobile-icons'
import { withRouter } from 'react-router-dom';

class MyHeader extends Component {
    constructor(props) {
        super(props);
    }

    toSearch() {
        this.props.history.push('/searchPage')
    }
    handleClick3 = () => {
        console.log(this);
        this.setState({});//触发组件更新
    }
    render() {
        return (
            <div className='input-box'>
                <input type="text" placeholder='搜索商品' onClick={() => { this.toSearch() }} />
                <div className='customer-service'>
                    <AudioOutline fontSize={20} />
                    <div onClick={this.handleClick3}>客服</div>
                </div>
            </div>
        );
    }
}

export default withRouter(MyHeader);